import axios from '@/libs/api.request'

export class CustomerSalaryApi {
  static get (path, params = {}) {
    return request.get(path, createGETParams(params))
  }

  static post (path, params = {}) {
    return request.post(path, params)
  }

  // 根据条件获取客户薪资账单
  static getList (params) {
    return axios.request({
      url: '/CustomerSalary/GetList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 获取薪资导入页面数据源
  static getImportConfig (params) {
    return axios.request({
      url: '/CustomerSalary/GetImportConfig',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 根据客户ID获取工资发放日期列表
  static getDayList (params) {
    return axios.request({
      url: '/CustomerSalary/GetDayList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出
  static export (params) {
    return axios.request({
      url: '/CustomerSalary/Export',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params,
      // responseType: 'blob'
    })
  }

  // 薪资导入
  static import (params) {
    return axios.request({
      url: '/CustomerSalary/Import',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 薪资结果导入
  static importResult (params) {
    return axios.request({
      url: '/CustomerSalary/ImportResult',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出错误数据附件
  static exportErrorFile (params) {
    return axios.request({
      url: '/CustomerSalary/ExportErrorFile',
      method: 'post',
      enctype: 'multipart/form-data',
      params: params
    })
  }

  // 批量删除薪资
  static delete (params) {
    return axios.request({
      url: '/CustomerSalary/Delete',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 提交财务
  static submitFinance (params) {
    return axios.request({
      url: '/CustomerSalary/SubmitFinance',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 批量导入
  static importMultiple (params) {
    return axios.request({
      url: '/CustomerSalary/ImportMultiple',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 退回
  static back (params) {
    return axios.request({
      url: '/CustomerSalary/Back',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 批量导入多个客户薪资的模板地址取接口
  static getBatchImportConfig () {
    return axios.request({
      url: '/CustomerSalary/GetBatchImportConfig',
      method: 'get',
      enctype: 'multipart/form-data',
    })
  }
}
